package com.chinasofti.udp02;

import java.io.IOException;
import java.net.*;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds = new DatagramSocket();
        String s = "广播 hello";
        byte [] byts = s.getBytes();
        InetAddress address =InetAddress.getByName("255.255.255.255");
        int port = 10000;
        DatagramPacket dp = new DatagramPacket(byts, byts.length,address,port);
        ds.send(dp);
        ds.close();

    }
}
